﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BL;
using DA;
using System.Data;
using System.Data.Entity;

namespace StoreSystem
{
    public partial class ProductByCategory : System.Web.UI.Page
    {
        DataManager bl = new DataManager();
        protected void Page_Load(object sender, EventArgs e)
        {
            DropDownListCategories.DataSource = bl.GetCategories();
            DropDownListCategories.DataTextField = "Name";
            DropDownListCategories.DataValueField = "CategoryId";
            DropDownListCategories.DataBind();
            Productim.DataSourceU = bl.GetProductsByCategory(int.Parse(DropDownListCategories.SelectedValue.ToString()));
            Productim.DataBind();
        }
    }
}